let connectSocketInit = function() {
  // 创建websocket连接
  
  let Socket = uni.connectSocket({
		url: "ws://39.106.224.233:8088/chat/socket/lh0117/lh0117",   //wss协议链接地址
    header:{
      'content-type': 'application/json'
    },
    success(res) {

			console.log(res,"websocket创建成功");
    },
    fail(err){
      console.log('创建失败',err);
    }
  });
  uni.onSocketClose(function (res) {
    console.log('WebSocket 已关闭！');
  });
  
	//监听WebSocket连接打开事件
	// wx.onSocketOpen(function(res) {
	// 	console.log('WebSocket连接已打开！');
  // })
  // wx.onSocketError(function (res) {
  //   console.log('WebSocket连接打开失败，请检查！');
  // });
}

/*导出*/
export default {
	connectSocketInit
}
